<%--商品列表，负责人：熊程--%>

<%@ page import="jiaran.web.Tomxk.old.practice.pojo.Goods" %>
<%@ page import="jiaran.web.Tomxk.old.practice.JdbcUtils" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String sql="select `image` ,`name` ,`price` from `goods` ";
    List<Goods> goods = JdbcUtils.selects(sql, Goods.class);
    int i=0;
%>
<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java实训团队协作简单案例 - 商品列表页面</title>
    <link rel="shortcut icon" href="assets/img/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="assets/vendors/font-awesome-4.7.0/css/font-awesome.min.css" />
    <link rel="stylesheet" href="assets/css/core.css" />
    <link rel="stylesheet" href="assets/css/index.css" />
    <link rel="stylesheet" href="assets/css/a.css"/>
    <link rel="stylesheet" href="assets/css/goods.css" />
</head>

<body>
    <header>
        <div class="header-logo">
            <a href="index.jsp"><img src="assets/img/favicon.png" /></a>
        </div>
        <div class="header-title">嘉然今天吃什么</div>
        <div class="header-people">
            <span class="header-people-name">
                <b>张三</b> <i class="fa fa-chevron-left"></i>
            </span>
            <div class="header-people-menu">
                <a href="resume.jsp">个人信息</a>
                <a href="login.jsp">注销</a>
            </div>
        </div>
    </header>
    <section class="container">
        <div class="main-left">
            <div class="main-left-menu">
                <a href="goods-list.jsp"><i class="fa fa-cubes"></i> 商品管理</a>
                <a href="user-list.jsp"><i class="fa fa-users"></i> 用户管理</a>
            </div>
        </div>
        <div class="main-right">
            <h3>商品列表页面</h3>
            <a href="goods-edit.jsp"><i class="fa fa-plus"></i> 新增商品</a>
            <div class="goods-container">
                <%for (Goods goods1:goods){i++;%>
                    <div class="goods-item">
                        <img class="goods-img" src="/images/<%=goods1.getImage()%>" />
                        <span class="goods-price">商品价格:<%=goods1.getPrice() %></span>
                        <span class="goods-title">商品名称:<%=goods1.getName()%></span>
                        <span class="goods-footer">
                            <i class="fa fa-pencil"></i>
                            <a href="/user/d?id=<%=goods1.getName()%>">
                                <i class="fa fa-trash"></i>
                            </a>
                        </span>
                    </div>
                <%}%>
                <%while (i<10){i++;%>
                <div class="goods-item">
                    <img class="goods-img" src="" />
                    <span class="goods-price">￥89.89</span>
                    <span class="goods-title">商品名称</span>
                    <span class="goods-footer">
                            <i class="fa fa-pencil"></i>
                            <i class="fa fa-trash"></i>
                        </span>
                </div>

                <%}%>
            </div>
            <div class="goods-pager">
                <span>总共 <b>30</b> 条数据，当前是第 <b>1</b> 页。</span>
                <button type="button">上一页</button>
                <button type="button">下一页</button>
            </div>
        </div>
    </section>
</body>

</html>